define(function(require, exports){
	exports.onMain = function(boot,data,app){
		if (!app.routerValid('admin.whisky')) {
			return;
		}
		var title = LANG('落地页报表');
		var con = app.getContainer({
			scenes: 'main',
			full: false,
			sitelist: false,
			setup_btn: false,
			title: title,
			type: 'sidebar'
		});

		app.core.get('SYS_PLATFORM').setPlatform(title);

		con.createBusiness(data.name, 'whisky/action/list.base', {
			tabText: LANG('落地页')
		}, function(mod, created){
			if(created){
				mod.reload();
			}
		});
	};


	exports.onEdit = function(boot,data,app){
		var id = data.param;
		var auth = id ? 'whisky.update' : 'whisky.add';
		var title = id ? LANG('编辑落地页') : LANG('添加落地页');
		if (!app.routerValid(auth)) {
			return;
		}

		var con = app.getContainer({
			scenes: 'main',
			full: false,
			sitelist: false,
			setup_btn: false,
			title: title,
			type: 'scroll'
		});

		app.core.get('SYS_PLATFORM').setPlatform(title);

		con.createBusiness(data.name, 'whisky/action/edit.base', {
		}, function(mod){
			mod.reset();

			// 编辑状态
			if(id){
				mod.load(id);
			}
		});
	};

	exports.onDetail = function(boot,data,app){
		var id = data.param;
		if (!app.routerValid('whisky.info')) {
			return;
		}

		var con = app.getContainer({
			scenes: 'main',
			full: false,
			sitelist: false,
			setup_btn: false,
			title:LANG('落地页详情'),
			header:LANG('落地页详情')
		});

		con.createBusiness(data.name, 'whisky/action/detail.base', {
		}, function(mod){
			mod.reset();
			if(id){
				mod.load(id);
			}
		});
	};
});